//
//  YTXObject.cpp
//  Chart
//
//  Created by CaoJun on 15/2/15.
//
//

#include "YTXObject.h"

using namespace ytx;

YTXObject::YTXObject(void)
: m_uReference(0)
{

}

YTXObject::~YTXObject(void)
{
    // nothing to do
}

void YTXObject::release(void)
{
    --m_uReference;
    
    if (m_uReference == 0)
    {
        delete this;
    }
}

void YTXObject::retain(void)
{
    ++m_uReference;
}

bool YTXObject::isSingleReference(void) const
{
    return m_uReference == 1;
}

unsigned int YTXObject::retainCount(void) const
{
    return m_uReference;
}

bool YTXObject::isEqual(const YTXObject *pObject)
{
    return this == pObject;
}
